#include <iostream>
#include <unistd.h>
#include <pthread.h>

/*
 * https://cloud.tencent.com/developer/article/2329949
 */

using namespace std;

void * threadRun(void *arg)
{
    while (true) {
        cout << "I am other thread, run..." << endl;
		sleep(1);
    }

	return NULL;
}

int main()
{
	pthread_t t;
	pthread_create(&t, NULL, threadRun, NULL);

	while (true) {
		cout << "I am main thread" << "I wad created one thread" << t << endl;
		sleep(1);
	}

	return 0;
}
